<!-- php:$title ="我的财富_会员中心"  -->
<!-- include tpl=header title=$title -->
<script type="text/javascript">
function payit(id,title)
{
	$.dialog.prompt('请输入要充值的金额（仅支持整数，最小充值1元）：',function(val){
		if(val < 1){
			$.dialog.alert('充值金额不能少于1元');
			return false;
		}
		var url = get_url('payment','index','id='+id+"&price="+$.str.encode(val));
		$.phpok.go(url);
	},10).title('在线充值');
}
</script>
<section class="container"><div class="mt-3"><!-- include tpl=block/breadcrumb --></div></section>
<section class="container">
	<div class="row">
		<div class="col-sm-3">
			<!-- include tpl=block/usercp_nav -->
		</div>
		<div class="col-sm-9">
			<div class="card">
				<div class="card-header">我的财富</div>
				<table class="table">
					<tbody>
						<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
						<tr>
							<td>
								<div><b>{$value.title}</b>，您当前有 <span class="red">{$value.val}</span> {$value.unit}</div>
								<!-- if $value.ifpay -->
								<div class="gray">充值比例：1元人民币 = {$value.pay_ratio} {$value.unit}</div>
								<!-- /if -->
								<!-- if $value.ifcash && !$value.ifpay -->
								<div class="gray">抵现比例：100{$value.unit} = {$value.cash_ratio}元人民币，可用于抵扣购物金额</div>
								<!-- /if -->
							</td>
							<td class="text-center">
								<!-- if $value.ifpay --><input type="button" value="充值" class="btn btn-primary btn-sm" onclick="payit('{$value.id}','{$value.title}')" /><!-- /if -->
							</td>
							<td class="text-center">
								<a href="{url ctrl=usercp func=wealth_log id=$value.id/}" class="btn btn-primary btn-sm">日志</a>
							</td>
						</tr>
						<!-- /loop -->
					</tbody>
				</table>
			</div>
		</div>
	</div>
</section>
<!-- include tpl=footer -->